package com.ysyx.ysyx_message.controller;

import com.ysyx.ysyx_message.dto.BaseDto;
import com.ysyx.ysyx_message.service.ReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 *
 * @description: 评价接口/类
 * @author:郭宇轩
 * @create:2023/4/19 9:39
 */
@RestController
@RequestMapping("/review")
public class ReviewController {

    @Autowired
    private ReviewService reviewService;

    //请使用ReviewService
    //DriverviewPojoService、PassengerviewPojoService为MyBatisPlus自动生成

    @RequestMapping(value = "/passengerReview",method = RequestMethod.GET)
    public BaseDto passengerReview( String orderId,Integer score){

        System.out.println("orderId==="+orderId+",score==="+score);


        BaseDto baseDto = reviewService.passengerReview(orderId,score);
        return baseDto;
    }

    @RequestMapping(value = "/driverReview",method = RequestMethod.GET)
    public BaseDto driverReview(String orderId,Integer score){
        BaseDto baseDto = reviewService.driverReview(orderId,score);
        return baseDto;
    }

    @RequestMapping(value = "/passengerReviewList",method = RequestMethod.GET)
    public BaseDto passengerReviewList(Integer passengerId){
        BaseDto baseDto = reviewService.passengerReviewList(passengerId);
        return baseDto;
    }

    @RequestMapping(value = "/driverReviewList",method = RequestMethod.GET)
    public BaseDto driverReviewList(Integer driverId){
        BaseDto baseDto = reviewService.driverReviewList(driverId);
        return baseDto;
    }

//    @RequestMapping("/passengerCheck")
//    public BaseDto passengerCheckReview(String orderId){
//        return null;
//    }
//
//    @RequestMapping("/driverCheck")
//    public BaseDto driverCheckReview(String orderId){
//        return null;
//    }
}
